<?php
/**
 * @user:andy
 * @date:2021/7/3
 * @company:http://www.sjdphp.com
 * @desc:
 */

namespace app\admin\validate;


use think\Validate;

class RoleValidate extends Validate
{
    protected $rule = [
        'role_id'   => 'require|number',
        'role_name' => 'require',
        'powers'    => 'require',
    ];

    protected $message = [
        'role_id.require'   => '角色ID不能为空',
        'role_id.number'    => '角色ID类型错误',
        'role_name.require' => '角色名称不能为空',
        'powers.require'    => '角色权限不能为空',
    ];

    protected $scene = [
        'add'  => ['role_name','powers'],
        'edit' => ['role_id','role_name','powers'],
    ];
}